[XEND] Check for and fail on non-existent floppy-drive file when starting HVM guest.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Sun, 15 Oct 2006 08:19:26 +0000 (09:19 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Sun, 15 Oct 2006 08:19:26 +0000 (09:19 +0100)
The qemu device model hangs when a non-existent floppy file is passed
via 'fda' or 'fdb'. The attached patch checks whether the floppy file
exists and raises an error if it does not.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
tools/python/xen/xend/image.py

index 28a8952eec69e2d4ed0e5cc7c05b66234a818a4f..fe416e2ba5d285cc75d69439f81cc7f60538c9bb 100644 (file)
@@ -312,6 +312,11 @@ class HVMImageHandler(ImageHandler):
                 if v:
                     ret.append("-%s" % a)
                     ret.append("%s" % v)
+
+            if a in ['fda', 'fdb' ]:
+                if v:
+                    if not os.path.isfile(v):
+                        raise VmError("Floppy file %s does not exist." % v)
             log.debug("args: %s, val: %s" % (a,v))
 
         # Handle disk/network related options